import Vue from 'vue';
import Router from 'vue-router';
// import RealTimeDataReporting from "../components/RealTimeDataReporting.vue"
// import MainPage from "../components/MainPage.vue"

const RealTimeDataReporting = () =>
  import('../components/RealTimeDataReporting.vue');
const MainPage = () => import('../components/MainPage.vue');
const Login = () => import('../views/login/Main.vue');
const ForgetPassword = () => import('../views/login/ForgetPassword.vue');

// import Login from '../views/Login.vue'

Vue.use(Router);

const router = new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login,
    },
    {
      path: '/RealTimeDataReporting',
      name: 'RealTimeDataReporting',
      component: RealTimeDataReporting,
    },
    {
      path: '/MainPage',
      name: 'MainPage',
      component: MainPage,
    },
    {
      path: '/ForgetPassword',
      name: 'ForgetPassword',
      component: ForgetPassword,
    },
  ],
});

router.beforeEach(function(to, from, next) {
  console.log('--->to: ', to);
  console.log('--->from: ', from);
  console.log('--->next: ', next);
  next();
});

export default router;
